import request from '@/utils/request'
import store from '@/store'

// 模拟面试筛选条件接口
export const getFiltersData = () => {
  return request({
    url: '/interview/filters'
  })
}

// 获取模拟面试题接口
export const getQuestions = (params) => {
  return request({
    url: '/interview/questions',
    params,
    headers: {
      authorization: 'Bearer ' + store.state.user.token
    }
  })
}

// 面试题详情
export const questionDetail = (id) => {
  return request({
    url: '/questions/' + id,
    headers: {
      authorization: 'Bearer ' + store.state.user.token
    }
  })
}

// 面试题提交
export const submit = (data) => {
  return request({
    url: '/questions/submit/',
    method: 'POST',
    data,
    headers: {
      authorization: 'Bearer ' + store.state.user.token
    }
  })
}
